const user = require('../dao/user')

const login = (userData) => {
  const { username, password } =  userData
  return user.login(username, password).then(rows => {
    return rows[0] || {}
  })
}

module.exports = {
  login
}
